<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="menu" class="util.Menu" scope="session"></jsp:useBean>

<% String imgPath = request.getContextPath()+"/common/image/"; %>

<table style="width: 180px;" border="0" cellpadding="0" cellspacing="0">
<!-- 커뮤니티 이름 출력 -->
<logic:greaterThan value="9" property="cono" name="menu" scope="session">
		<tr><td id="commTd" style="width: 180px;height: 40px;background: #000000;text-align: center;" onclick="backtoComm(<bean:write name="menu" property="cono"/>)" onmouseover="cursor1()">
			<span style="color: #ffffff;font-weight: bold;"><bean:write name="menu" property="community.coname"/></span>
		</td>	</tr>
</logic:greaterThan>

	<tr><td><img src="<%=imgPath %>left_01.jpg"/></td></tr>
	
<!-- 공지사항 게시판 출력 -->
<logic:notEmpty name="menu" property="noticeBoardMenus" scope="session">
	<tr><td><img src="<%=imgPath %>left_notice.jpg"/></td></tr>
<logic:iterate id="nbmenues" name="menu" property="noticeBoardMenus" scope="session">
	<tr><td style="padding-left:20px; width: 180px;height: 20px;background-image: url('<%=imgPath %>left_02.jpg');">∴<span class="leftlink">
	<a href="javascript:getBoard('<bean:write name="nbmenues" property="url"/>','<bean:write name="nbmenues" property="bname"/>');">
	<bean:write name="nbmenues" property="bname"/></a></span></td></tr>
</logic:iterate>

</logic:notEmpty>

<!-- 자유게시판 목록 출력 -->
<logic:notEmpty name="menu" property="freeBoardMenus" scope="session">
	<tr><td><img src="<%=imgPath %>left_board.jpg"/></td></tr>	
<logic:iterate id="fbmenues" name="menu" property="freeBoardMenus" scope="session">
	<tr><td style="padding-left:20px; width: 180px;height: 20px;background-image: url('<%=imgPath %>left_02.jpg');">∴<span class="leftlink">
	<a href="javascript:getBoard('<bean:write name="fbmenues" property="url"/>','<bean:write name="fbmenues" property="bname"/>');">
	<bean:write name="fbmenues" property="bname"/></a></span></td></tr>

</logic:iterate>

</logic:notEmpty>


<!-- 자료실 목록 출력 -->
<logic:notEmpty name="menu" property="dataBoardMenus" scope="session">
	<tr><td><img src="<%=imgPath %>left_data.jpg"/></td></tr>
<logic:iterate id="dbmenues" name="menu" property="dataBoardMenus" scope="session">
	<tr><td style="padding-left:20px; width: 180px;height: 20px;background-image: url('<%=imgPath %>left_02.jpg');">∴<span class="leftlink">
	<a href="javascript:getBoard('<bean:write name="dbmenues" property="url"/>','<bean:write name="dbmenues" property="bname"/>');">
	<bean:write name="dbmenues" property="bname"/></a></span></td></tr>
</logic:iterate>

</logic:notEmpty>

<!-- 사진게시판 목록 출력 -->
<logic:notEmpty name="menu" property="photoBoardMenus" scope="session">
	<tr><td><img src="<%=imgPath %>left_photo.jpg"/></td></tr>
<logic:iterate id="pbmenues" name="menu" property="photoBoardMenus" scope="session">
	<tr><td style="padding-left:20px; width: 180px;height: 20px;background-image: url('<%=imgPath %>left_02.jpg');">∴<span class="leftlink">
	<a href="javascript:getBoard('<bean:write name="pbmenues" property="url"/>','<bean:write name="pbmenues" property="bname"/>');">
	<bean:write name="pbmenues" property="bname"/></a></span></td></tr>
</logic:iterate>

</logic:notEmpty>

<!-- QnA 게시판 출력 -->
<logic:notEmpty name="menu" property="qnaBoardMenu" scope="session">
	<tr><td><img src="<%=imgPath %>left_qna.jpg"/></td></tr>
	<tr><td style="padding-left:20px; width: 180px;height: 20px;background-image: url('<%=imgPath %>left_02.jpg');">∴<span class="leftlink">
	<a href="javascript:getBoard('<bean:write name="menu" property="qnaBoardMenu.url"/>','<bean:write name="menu" property="qnaBoardMenu.bname"/>');">
	<bean:write name="menu" property="qnaBoardMenu.bname"/></a></span></td></tr>

</logic:notEmpty>
	

<!-- 가입한 커뮤니티 출력 -->
<logic:notEmpty name="menu" property="memberCommunitys" scope="session">
	<tr><td style="height: 20px;"><img src="<%=imgPath %>left_comm.jpg"/></td></tr>
	<tr><td style="height: 20px;background-image: url('<%=imgPath%>left_02.jpg');text-align: center;padding-top:2px;">
	<form name="urlForm">
		<select name="url" onchange="changeUrl()" style="width: 140px;height: 18px;font-size: 8pt;">
			<logic:iterate id="mc" name="menu" property="memberCommunitys" type="model.MemberCommunity">
				<option value="<bean:write name="mc" property="cono"/>"><bean:write name="mc" property="coname"/></option>
			</logic:iterate>
		</select></td></tr>			
	</form>
</logic:notEmpty>

	
<!-- 링크 풀다운메뉴 출력 -->
<logic:notEmpty name="menu" property="commLinkMenus" scope="session">
	<tr><td style="height: 20px;"><img src="<%=imgPath %>left_link.jpg"/></td></tr>
	<tr><td style="text-align: center;background-image: url('<%=imgPath %>left_02.jpg');height:20px;padding-top:2px;">
		<select id="clinks" onchange="openLink()" style="width: 140px;;height: 18px;font-size: 8pt;">
			<option selected="selected">링크 사이트</option>
<logic:iterate id="clmenues" name="menu" property="commLinkMenus" scope="session">
			<option value="<bean:write name="clmenues" property="linkaddress"/>"><bean:write name="clmenues" property="linkname"/></option>
</logic:iterate>
		</select></td></tr>
</logic:notEmpty>

	<tr><td><img src="<%=imgPath %>left_03.jpg"/></td></tr>

<!-- 커뮤니티 전용 메뉴  출력 -->
<logic:notEmpty name="menu" property="cono" scope="session">
	<logic:greaterThan value="9" name="menu" property="cono">
		<tr><td align="center">
			<a href="<%=request.getContextPath()%>/community/communityjoin.do?method=getForm&cono=<bean:write name="membercommunity" property="cono"/>" onclick="return check()">
			<img src="<%=imgPath %>community_join.jpg" border="0"/>
			</a>
		</td></tr>
	</logic:greaterThan>
</logic:notEmpty>

<logic:notEmpty name="membercommunity" property="mid" scope="session">
	<logic:equal value="7" name="membercommunity" property="lvno" scope="session">
		<tr><td style="text-align: center;">
			<a href="<%=request.getContextPath()%>/community/communityinfo.do?method=adminMain&cono=<bean:write name="membercommunity" property="cono"/>">
				<img src="<%=imgPath %>community_admin.jpg" border="0"/></a>
		</td></tr>
	</logic:equal>
	
	<logic:notEqual value="7" name="membercommunity" property="lvno" scope="session">
		<logic:greaterEqual value="8" name="user" property="userInfo.lvno">
		<tr><td style="text-align: center;">
				<a href="<%=request.getContextPath()%>/community/communityinfo.do?method=adminMain&cono=<bean:write name="membercommunity" property="cono"/>">
					<img src="<%=imgPath %>community_admin.jpg" border="0"/></a>
			</td></tr>
		</logic:greaterEqual>
	</logic:notEqual>

</logic:notEmpty>

</table>
<script type="text/javascript" >
	function openLink(){
		var clinks = document.getElementById('clinks');
		var selectedIndex = clinks.selectedIndex;
		if(selectedIndex==0){}
		else{
			var url=clinks.options[selectedIndex].value;
			window.open(url,'_blank');
		}
	}
	
	function backtoComm(n){
		location.href="<%=request.getContextPath()%>/community/community.do?cono="+n;
	}
	
	function cursor1(){
		commTd.style.cursor = 'hand';
	}
	
	function changeUrl(){
		var selectedIndex = window.document.urlForm.url.selectedIndex;
		if(selectedIndex==0){}
		else{
			var url=window.document.urlForm.url.options[selectedIndex].value;
			if(url!=0){
				url = '<%=request.getContextPath()%>/community/community.do?cono='+url;
				location.href=url;
			}
		}
	}

</script>